FROM node:22.11

RUN mkdir -p /app/automation/

COPY . /app/automation

WORKDIR /app/automation

#安装依赖:通过npm安装依赖时,有时会报错,这时可以通过安装cnpm来安装依赖
RUN  npm install -g cnpm --registry=http://registry.npmmirror.com
RUN cnpm install

EXPOSE 8888

# 容器启动时执行的命令，类似npm run start
CMD ["npm","run", "serve"]

#docker build -t automation .
#docker run -p 80:80 -d --name automation automation
#docker update --restart=always automation